import env from '../../build/env';

const SERVER_DOMAIN = env === 'development'
    /* ? '192.168.0.111:8080' */
    /* ? 'localhost:8081' */
    //    ? 'localhost:8081'
        ? 'localhost:8081'
        : env === 'production'
            ? '47.99.127.112:80'
            : 'debug.url.com',
    // ? 'www.url.com'
    // : 'debug.url.com',
    SERVER_HOST = '//' + SERVER_DOMAIN + '/',
    API = {
        LOGIN: '/base/user/login',
        USER_LIST: '/base/user/list',
        USER_SAVE: '/base/user/save',
        USER_DETAIL: '/base/user/detail',

        ROLE_LIST: '/base/role/list',
        ROLE_SAVE: '/base/role/save',
        ROLE_DETAIL: '/base/role/detail',

        MENU_LIST: '/base/menu/list',
        MENU_SAVE: '/base/menu/save',
        MENU_DETAIL: '/base/menu/detail'
    },
    output = {};

for (let key in API) {
    output[key] = /* SERVER_HOST + */API[key];
}

output['SERVER_DOMAIN'] = SERVER_DOMAIN;
output['SERVER_HOST'] = SERVER_HOST;

export default output;
